package com.txw.javaCore.api.enums;

import java.text.DateFormat;
import java.text.SimpleDateFormat;

/**
 * 常量配置
 * Created by Administrator on 2020/7/7.
 */
public class Constant {

    public static final String RedisMapCacheUserOrder="MapCache:User:Order:V2";

    public static final String DateTimeFormat="yyyy-MM-dd HH:mm:ss";

    public static ThreadLocal<DateFormat> dateFormatThreadLocal=ThreadLocal.withInitial(() -> new SimpleDateFormat(DateTimeFormat));

    //支付状态（10=未支付；20=已支付；30=已发货；40=用户已收货；50=系统自动收货；60=用户已取消；70=系统已自动取消）
    public enum OrderPayStatus{

        UnPay(10,"未支付"),
        HasPay(20,"已支付"),
        HasDelivery(30,"已发货"),
        UserReceiveGood(40,"用户已收货"),
        SystemReceiveGood(50,"系统自动收货"),
        UserCancel(60,"用户已取消"),
        SystemCancel(70,"系统已自动取消"),
        ;

        OrderPayStatus(Integer code, String msg) {
            this.code = code;
            this.msg = msg;
        }

        private Integer code;
        private String msg;

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }

        public String getMsg() {
            return msg;
        }

        public void setMsg(String msg) {
            this.msg = msg;
        }
    }


    public static final Integer indexPageNo=1;
    public static final Integer indexPageSize=20;
    public static final Integer indexPageImgSize=10;
    public static final Integer indexPageLinkSize=10;



    public static final Long batchDataSize=40000L;



    //消息的状态：0投递中 1投递成功 2投递失败 3已消费
    public enum MsgStatus{

        Sending(0,"投递中"),
        SendSuccess(1,"投递成功"),
        SendFail(2,"投递失败"),
        ConsumeSuccess(3,"消费成功"),
        ConsumeFail(4,"消费失败"),

        ;

        private Integer status;
        private String msg;

        MsgStatus(Integer status, String msg) {
            this.status = status;
            this.msg = msg;
        }

        public Integer getStatus() {
            return status;
        }

        public void setStatus(Integer status) {
            this.status = status;
        }

        public String getMsg() {
            return msg;
        }

        public void setMsg(String msg) {
            this.msg = msg;
        }
    }


    //订单类型
    public enum OrderType{

        Item("SP","商品订单"),
        Sale("XS","销售订单"),

        ;

        private String type;
        private String desc;

        OrderType(String type, String desc) {
            this.type = type;
            this.desc = desc;
        }

        public String getType() {
            return type;
        }

        public void setType(String type) {
            this.type = type;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }
    }

    //首页微博数据点赞、收藏、转发、评论、关注 缓存存储Key
    public static final String KeyPraise="redis:mini:blog:praise:";

    public static final String KeyCollect="redis:mini:blog:collect:";

    public static final String KeyForward="redis:mini:blog:forward:";

    public static final String KeyConcern="redis:mini:blog:concern:";

    public static final String KeyComment="redis:mini:blog:comment";
}






























